<template>
  <div class="Deleted-day">
    <List
      :linklist="linklist"
      :tableData="tableData"
      :btnList="btnList"
      :titleList="titleList"
      :isCheck="isCheck"
      :selWidth="selWidth"
    ></List>

  </div>
</template>

<script>
import List from "../../components/List.vue";
import { WeekDeletedAxios } from "../../http/apis/deletedApi";
import { timeFormat } from "../../utils/utils";
export default {
  name: "DeletedDay",
  components: {
    List,
  
  },
    created() {
    WeekDeletedAxios()
      .then((res) => {
        console.log(res.data.data);
        let arr = [];
        res.data.data.forEach((item) => {
          let obj = {
            id: item.recycle_id,
            username: item.customer.customer_name,
            deleteReason: item.delete_reason,
            deleteTime: timeFormat(item.delete_date),
            salesman: item.employee.employee_name,
          };
          arr.push(obj);
        });
        // console.log("$", arr);
        this.tableData = arr;
      })
      .catch((err) => {
        console.log("请求数据失败:", err);
      });
  },
  data() {
    return {
      isCheck: true,
      //列表标题
      linklist: [
        {
          id: "0",
          name: "客户名称",
          isRouter: true,
          url: "",
        },
        {
          id: "1",
          name: "删除原因",
        },
        {
          id: "2",
          name: "删除时间",
        },
        {
          id: "3",
          name: "业务员",
        },
      ],
      // 操作按钮
      btnList: [
        {
          id: "1",
          name: "还原",
        },
        {
          id: "2",
          name: "转入公海",
        },
        {
          id: "3",
          name: "彻底删除",
        },
      ],
      // 字段名称
      titleList: ["username", "deleteReason", "deleteTime", "salesman"],
      // 模拟数据
      tableData: [
      ],
       selWidth: {
        checkBox: 40,
        tools: 100,
      },
    };
  },
};
</script>

<style>
</style>